home *** CD-ROM | disk | FTP | other *** search
/ Champak 52 / Volume 52 - JOGO DISK .iso / Games / shopdrop.swf / scripts / __Packages / Fader.as < prev    next >
Text File  |  2007-09-27  |  872b  |  36 lines

  1. class Fader extends MovieClip
  2. {
  3.    var fadeUpdates = 4;
  4.    var alphaGoal = 25;
  5.    var cFade = 0;
  6.    function Fader()
  7.    {
  8.       super();
  9.       this._visible = false;
  10.    }
  11.    function fade()
  12.    {
  13.       _global.mcRoot.mcStuffHolder.mcPlayer.stopWalk();
  14.       this._visible = true;
  15.       this._alpha = 100;
  16.       this.cFade = 0;
  17.       this.onEnterFrame = this.fadeUpdate;
  18.    }
  19.    function fadeUpdate()
  20.    {
  21.       this._alpha = 100 - (100 - this.alphaGoal) * (this.cFade / this.fadeUpdates);
  22.       this.cFade = this.cFade + 1;
  23.       if(this.cFade >= this.fadeUpdates)
  24.       {
  25.          this.onEnterFrame = null;
  26.          this._visible = false;
  27.          _global.mcRoot.mcCountdown._visible = true;
  28.          _global.mcRoot.mcCountdown.play();
  29.       }
  30.       else
  31.       {
  32.          _global.mcRoot.mcStuffHolder.mcPlayer.stopWalk();
  33.       }
  34.    }
  35. }
  36.